package com.ronan.common.utils;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * FileName    : com.ronan.common.utils
 * Description : 路由管理
 *
 * @author : ronan
 * @version : 1.0
 * Create Date : 2021/3/8 16:20
 * @Copyright : WithUFuture Software Co.,Ltd.Rights Reserved
 * @Company : 深圳幻影未来信息科技有限公司
 **/
public class RouteManager {

    private static final Map<String, String> ROUTE_MAP = new ConcurrentHashMap<>();

    public static void putRoute(String userId,String route) {
        ROUTE_MAP.put(userId,route);
    }

    public static String getRoute(String userId) {
        return ROUTE_MAP.get(userId);
    }

    public static void removeRoute(String userId) {
        ROUTE_MAP.remove(userId);
    }

    public static void removeAll() {
        ROUTE_MAP.clear();
    }
}
